package fuxi;

import java.util.ArrayList;
import java.util.List;

public class Zoo {
	List <Animal> Animals= new ArrayList<Animal>();
	public Zoo() {
		Cat c = new Cat();
		Dog d1=new Dog();
		Dog d2= new Dog();
		Animals.add(c);
		Animals.add(d1);
		Animals.add(d2);
	}
	public void speak() {
		for (int i =0;i<Animals.size();i++){
			Animal a1=Animals.get(i);
			a1.speak();
			}
		}

	public static void main(String[] args) {
		
	}

}
